// load all scripts included in the document
var scripts=document.getElementsByTagName("SCRIPT");
var script;
for (var i=0; i < scripts.length; i++)
{
    script=scripts[i];
    if (script.getAttribute("type") == "text/javascript")
    {
        var src=script.getAttribute("src");
        domState.loadScript(src);
    }
}

// We insert an additional script into the header which removes our 
// event links if the user has javascript enabled.
// You might want to consider adding javascript detection to your app so 
// that the dom interceptor is only called for users that don't have javascript.
// This would save a lot of server resources.
//
// Since we already loaded the scripts this script won't be loaded in server mode

var head=document.getElementsByTagName("HEAD")[0];
var script=document.createElement("script");
script.setAttribute("type","text/javascript");
script.setAttribute("src", domState.contextPath+"/script/removeEvent.js");
head.appendChild(script);
